Developer --> Technical Publications
PATHMac OS 8 Developer Documentation > Human Interface Toolbox > Menu Manager >

Mac OS 8 Menu Manager Reference


Initializing the Menu Manager

The following Menu Manager functions for initializing the Menu Manager are new, changed, or not recommended with Appearance Manager 1.0:


InitContextualMenus

Adds a program to the system registry of contextual menu clients.

pascal OSStatus InitContextualMenus (void);
function result
A result code; see Result Codes .

DISCUSSION

Your program should call the InitContextualMenus function early in your startup code to register your application as a contextual menu client. If you do not register your program, some system-level functions may respond as though your program does not use contextual menus. Not registering your program may also cause ProcessIsContextualMenuClient to return an incorrect value.

If you have a 68K program, you must pass the selector gestaltContextualMenuAttr to the Gestalt function before calling the InitContextualMenus function. If the Gestalt function returns a bit field with the gestaltContextualTrapAvailable bit set, InitContextualMenus can be called; see Contextual Menu Gestalt Selector Constants .


VERSION NOTES

Available with Appearance Manager 1.0 and later.


ProcessIsContextualMenuClient

Determines whether a given program is a contextual menu client.

pascal Boolean ProcessIsContextualMenuClient(ProcessSerialNumber* inPSN);
inPSN
A pointer to the ID of the process containing the program.
function result
A Boolean value. ProcessIsContextualMenuClient returns true if the program in the process uses contextual menus; otherwise, false .

DISCUSSION

The ProcessIsContextualMenuClient function checks the system registry of contextual menu clients and returns true if the program in the given process supports contextual menus. However, the program must have been registered as a client using InitContextualMenus .


VERSION NOTES

Available with Appearance Manager 1.0 and later.


SEE ALSO

Contextual Menu Gestalt Selector Constants .


InitProcMenu

Sets the mbResID field of the current menu list to the resource ID of a custom 'MBDF' resource.

pascal void InitProcMenu (short resID);
resID
The resource ID of your application's menu bar definition function in the upper 13 bits of this parameter; the variant in the lower 3 bits. You must use a resource ID greater than 0x100. Resource IDs 0x000 through 0x100 are reserved for the use of Apple Computer, Inc.

DISCUSSION

If your application provides its own menu bar definition function, use the InitProcMenu function to associate your custom 'MBDF' resource with the current menu list. In general, you should not use a custom menu bar definition unless absolutely necessary. InitProcMenu creates the current menu list if it hasn't already been created by a previous call to InitMenus .

You can also call InitProcMenu to bypass mapping of the pre-Appearance menu resource ID constant textMenuProc to its corresponding Appearance-compliant menu resource ID constant kMenuStdMenuProc when mapping is enabled.


SPECIAL CONSIDERATIONS

The resource ID of your application's menu bar definition function is maintained in the current menu list until your application next calls InitMenus ; InitMenus initializes the mbResID field with the resource ID of the standard menu bar definition function. This can affect applications such as development environments that control other applications which may call InitMenus .


VERSION NOTES

Bypasses definition function mapping under Appearance Manager 1.0 and later.


© 1998 Apple Computer, Inc. - (Last Updated 19 Nov 98)

Previous | Back Up One Level | Next |